import { doCustomTimes } from "@/libs/utils"
import Mock from 'mockjs';

const Random = Mock.Random;

export const reportListData = () => {
    let reportList = [];
    doCustomTimes(3, () => {
        reportList.push(Mock.mock({
            id: Random.increment(),
            "KKScode|1": ["1KBF22CP001", "1MAX51AE001", "1KLE40AH013-M01", "1BTG21", "1KTT10AA108-M01"],
            "description|1": ["检查维护(1M)", "四年大修(4Y)", "定期标定", "11UCB厂房27米电梯右侧1GKC管道上有砂眼喷水", ""],
            finishTime: "@date"
        }));
    });
    return {
        data: reportList,
        success: true,
        msg: null
    }
}


export const paperReportListData = () => {
    let reportList = [];
    doCustomTimes(2, () => {
        reportList.push(Mock.mock({
            id: Random.increment(),
            "KKScode|1": ["1KBF22CP001", "1MAX51AE001", "1KLE40AH013-M01", "1BTG21", "1KTT10AA108-M01"],
            "description|1": ["检查维护(1M)", "四年大修(4Y)", "定期标定", "11UCB厂房27米电梯右侧1GKC管道上有砂眼喷水", ""],
            finishTime: "@date"
        }));
    });
    return {
        data: reportList,
        success: true,
        msg: null
    }
}

export const reportInfo = () => {
    let data = Mock.mock({
        id: Random.increment(3),
        "location|1": ["一楼", "二楼", "三楼"],
        "KKScode|1": ["1KBF22CP001", "1MAX51AE001", "1KLE40AH013-M01", "1BTG21", "1KTT10AA108-M01"],
        "description|1": ["检查维护(1M)", "四年大修(4Y)", "定期标定", "11UCB厂房27米电梯右侧1GKC管道上有砂眼喷水", ""],
        "finishTime":"@date",
        faultDescription: "",//故障描述
        faultAnalysis: "",//故障分析
        faultSolution:"",//故障措施
        "packageState|1": ["报告编制","已完成","进行中"],
        archiveDate:"@date",
        QDR:"7878979"
    });
    return {
        data:data,
        success:true,
        msg:null
    }
}

export const paperReportInfo = () => {
    let data = Mock.mock({
        id: "id",
        "location|1": ["一楼", "二楼", "三楼"],
        "KKScode|1": ["1KBF22CP001", "1MAX51AE001", "1KLE40AH013-M01", "1BTG21", "1KTT10AA108-M01"],
        "description|1": ["检查维护(1M)", "四年大修(4Y)", "定期标定", "11UCB厂房27米电梯右侧1GKC管道上有砂眼喷水", ""],
        "packageState|1": ["未完成,已完成,进行中"],
        faultDescription: "",//故障描述
        faultAnalysis: "",//故障分析
        faultSolution:"",//故障措施
        "packageState|1": ["报告编制,已完成,进行中"],
        "reportReceiver":"@cname",
        QDR:"7878979"
    });
    return {
        data:data,
        success:true,
        msg:null
    }
}

export const receiverList = () => {
    let staffList = [];
    doCustomTimes(10, () => {
        staffList.push(Mock.mock('@cname'))
    })
    return {
        data: staffList, 
        success: "true",
        msg:null
    }
  }

export const submitReportInfo = () => {
    return {
        data:null,
        success:true,
        msg:"保存成功"
    }
}

export const submitPaperReportInfo = () => {
    return {
        data:null,
        success:true,
        msg:"保存成功"
    }
}